<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--

  @(#)package.html	1.0 2003/08/23

  The contents of this file are subject to the Mozilla Public License Version 1.1
  (the "License"); you may not use this file except in compliance with the 
  License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

  Software distributed under the License is distributed on an "AS IS" basis,
  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
  for the specific language governing rights and
  limitations under the License.

  The Original Code is "The Columba Project"

  The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
  Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003. 

All Rights Reserved.

-->

</head>
<body bgcolor="white">

Plugin Framework
<p>
The extensibility system provides a framework for both, providing extensibility hooks, 
and for extending the functionality of Columba.
<p>
A plugin is a bundle of extensions. An extension provides an implementation of a 
specific functionality. 
<p>
The {@link IPluginManager} manages all plugins as a singleton registry. Additionally, it
is also a registry for all available extension handlers. {@link IExtensionHandler} is a 
registry for extensions. It resembles an extension point or hook to extend Columba's 
functionality. {@IExtension} provides the metadata, describing an extensions.
Additionally, it is responsible for instanciating an extension. Every extension must
implement the interface {@link IExtensionInterface}.
<p>
When looking at {@link IExtensionHandler}, its obvious that it simply resembles a 
registry for classes. All extensions have a unique id and the classname. The
extension handler keeps a hashtable of all extensions and uses a custom classloader
to instanciate extensions.
<p>
All extension handlers use xml files which can be found in <code>/res</code> directory.
This is merely an easy way to specify extensions easily, without hardcoding them in
Java. A list of all extension points for the core package can be found in:
<code>org.columba.core.plugin.pluginhandler.xml</code>. All core extension handler
files can be found in <code>org.columba.core.plugin</code>.
<p>

This is an example extension handler file:</br>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<extensionlist>
 <extension id="MailComponent" class="org.columba.mail.main.MailMain" />
 <extension id="AddressbookComponent" class="org.columba.addressbook.main.AddressbookMain" />
</extensionlist>
</pre>

<p>
Usually, when making use of extensions in Columba, you first get an instance of the
plugin manager using <code>PluginManager.getInstance()</code>. Then you have to 
retrieve an appropriate extension handler <code>getHandler(id)</code>. Using this
handler, you get the extension using <code>IExtensionHandler.getExtension(id)</code>.
Now, you instanciate the plugin using <code>IExtension.instanciate()</code>.
</body>
</html>
